import CryptoJS from 'crypto-js'

/**
 * 应用名称
 */
const appName = 'JMSAPP'

/**
 * 缓存器管理
 */
const cachers = new Map()

/**
 * 主题样式
 * normal：常规
 * dark：深色
 * simple：简约
 */
const themes = ['normal', 'dark', 'simple']

/**
 * 安全配置属性
 */
const secreyConfig = {
    AES_KEY: CryptoJS.enc.Utf8.parse('0j1m2s3b_4l5o6g7'), //16字节密钥
    AES_IV: CryptoJS.enc.Utf8.parse('ABCDEF1234123412')//十六位十六进制数作为密钥偏移量
}

/**
 * 路由config
 */
const routersConfig = [
    {
        path: '/', 
        element: './home/home.js',
        children: [
            {
                path: '/',
                element: './home/mainPage'
            },
            {
                path: '/write/blog/:id',
                element: './home/writeBlog'
            },
            {
                path: '/write/blog',
                element: './home/writeBlog'
            },
            {
                path: '/:customerId/blog/:id',
                element: './home/blogView'
            },
            {
                path: '/user/:id',
                element: './home/myBlog'
            },
            {
                path: '/personal/center/:id',
                element: './home/personalCenter'
            }
        ]
    },
    {
        path: '/jms/crawl',
        element: './crawl/crawlMain.js',
        children: [
            {
                path: '/jms/crawl',
                element: './crawl/crawlHome'
            },
            {
                path: '/jms/crawl/WeiBo',
                element: './crawl/weiboCrawl'
            },
            {
                path: '/jms/crawl/personal',
                element: './crawl/crawlPersonal'
            }
        ]
    },
    {path: '/login', element: './user/login.jsx'},
    {path: '/enroll', element: './user/enroll.jsx'},
    {path: '/forget', element: './user/forgetPwd'},
    {path: '/500', element: './error/Error500'},
    {path: '/404', element: './error/Error404'},
    {path: '/403', element: './error/Error403'},
    {path: '/crawl/home', element: './error/Error403'},
    {path: '/json/edit', element: './error/editor'},
]

const config = {
    routersConfig,
    cachers,
    themes,
    secreyConfig,
    appName
}

export default config